package com.ys.data.client;

import com.common.constant.FeignClientConstant;
import com.common.pojo.Result;
import com.common.vo.DictDataVo;
import com.common.vo.MessageLogVo;
import com.common.vo.RankingListVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
* @version: V1.0
* @author: szw
* @className: CoreClient
* @packageName: CoreClient
* @description: 核心服务-client
* @data: 2021-1-20 
**/   
@Component
@FeignClient(name= FeignClientConstant.YS_DATA_CORE_NAME)
public interface CoreClient {

    /**
     * 获取字典列表
     * @param dictDataVo
     * @return
     */
    @PostMapping("dict/findDictDataList")
    Result<?> findDictDataList(@RequestBody DictDataVo dictDataVo);


    /**
     * 添加排行榜数据
     * @param rankingListVo
     * @return
     */
    @PostMapping("ranking/save")
    Result<?> saveRankingList(@RequestBody RankingListVo rankingListVo);

    /**
     * 更新排行榜数据
     * @param rankingListVo
     * @return
     */
    @PostMapping("ranking/update")
    Result<?> updateRankingList(@RequestBody RankingListVo rankingListVo);

    /**
     * 更新排行榜数据
     * @param userId
     * @return
     */
    @PostMapping("ranking/find")
    Result<?> findUserRankingList(@RequestParam Long userId);

    /**
     * 查询排行榜数据
     * @param rankingListVo
     * @return
     */
    @PostMapping("ranking/page")
    Result<?> rankingListPage(@RequestBody RankingListVo rankingListVo,
                              @RequestParam(value = "pageNum") int pageNum,
                              @RequestParam(value = "pageSize")  int pageSize);


    /**
     * 保存发送的消息
     * @param messageLogVo
     * @return
     */
    @PostMapping(value = "message/save")
    Result<?> save(@RequestBody MessageLogVo messageLogVo);

    /**
     * 更新发送的消息
     * @param messageLogVo
     * @return
     */
    @GetMapping("message/update")
    Result<?> update(@RequestBody MessageLogVo messageLogVo);

    /**
     * 查询发送失败的消息
     * @param messageLogVo
     * @return
     */
    @PostMapping("message/find")
    Result<?> findFailureMes(@RequestBody MessageLogVo messageLogVo);
}